package com.ruoyi.web.core.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig  implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        // /photo/**是静态映射， file:/root/images/是文件在服务器的路径
//        registry.addResourceHandler("/photo/**")
//                .addResourceLocations("file:/photo/");
        registry.addResourceHandler("/www/wwwroot/baichenerp.com/baichenerpweb.com/photo/**")
                .addResourceLocations("file:/www/wwwroot/baichenerp.com/baichenerpweb.com/photo/");
    }
}
